#include <iostream>
#include <cstring>
using namespace std;

/*
    【题目192】创建一个employee类，该类中有字符数组，表示姓名、街道地址、市、省和
    邮政编码。把表示构造函数、changname()、display()的函数的原型放在类定义中，构造函数初
    始化每个成员，displayO函数把完整的对象数据打印出来。其中的数据成员是保护的，函数是
    公有的。
*/

class Employee
{
private:
    string name;
    string street;
    string city;
    string province;
    string postalcode;

public:
    Employee(string n, string s, string c, string p, string pc);
    void changename(string n);
    void display();
};

Employee::Employee(string n, string s, string c, string p, string pc)
{
    name = n;
    street = s;
    city = c;
    province = p;
    postalcode = pc;
}

void Employee::changename(string n)
{
    name = n;
}

void Employee::display()
{
    cout << name << "基本信息如下：" << endl;
    cout << "street: " << street << endl;
    cout << "city: " << city << endl;
    cout << "province: " << province << endl;
    cout << "postalcode: " << postalcode << endl
         << endl;
}

int main()
{
    Employee e1("zhangsan", "123", "beijing", "beijing", "100000");
    e1.display();
    e1.changename("lisi");
    e1.display();
    return 0;
}